package com.ltmall.api.enums;

/**
 * 小区团购banner枚举
 *
 * @author dou.guo
 * @Title DirectSupplyBannerEnum.java
 * @Description 类DirectSupplyBannerEnum.java的实现描述：类实现描述 
 * @date 2018年10月21日 下午3:21:11
 * @package com.wuwangkeji.homeflavor.enums
 */
public enum DirectSupplyBannerEnum {

    /**团购列表banner*/
    LIST_BANNER(0, "团购列表banner"),

    ;

    private int    code;
    private String name;

    private DirectSupplyBannerEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static DirectSupplyBannerEnum getEnumByCode(int code) {
        DirectSupplyBannerEnum[] arr = DirectSupplyBannerEnum.values();
        for (DirectSupplyBannerEnum e : arr) {
            if (e.code == (code)) {
                return e;
            }
        }
        return null;

    }

    public static DirectSupplyBannerEnum getEnumByName(String name) {
        if (name == null) {
            return null;
        }
        DirectSupplyBannerEnum[] arr = DirectSupplyBannerEnum.values();
        for (DirectSupplyBannerEnum e : arr) {
            if (e.name.equals(name)) {
                return e;
            }
        }
        return null;

    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
